package csc.fresher.service;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import csc.fresher.dao.SystemUserDao;
import csc.fresher.entity.SystemRecordLogin;
import csc.fresher.entity.SystemUser;

import java.io.*;

@Service
public class SystemUserServiceImpl implements SystemUserService , Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Autowired
	private SystemUserDao systemUserDao;

	@Override
	public long createSystemUser(SystemUser systemUser) {
		// TODO Auto-generated method stub
		return systemUserDao.createSystemUser(systemUser);
	}
	@Override
	public long updateSystemUser(SystemUser systemUser) {
		// TODO Auto-generated method stub
		return systemUserDao.updateSystemUser(systemUser);
	}

	@Override
	public List<SystemUser> getSystemUserByID(long systemUserID) {
		// TODO Auto-generated method stub
		return systemUserDao.getSystemUserByID(systemUserID);
	}

	@Override
	public List<SystemUser> getSystemUserByState(String systemUserState) {
		// TODO Auto-generated method stub
		return systemUserDao.getSystemUserByState(systemUserState);
	}


	@Override
	public List<SystemUser> getSystemUserByFirstName(String firstName) {
		// TODO Auto-generated method stub
		return systemUserDao.getSystemUserByFirstName(firstName);
	}

	@Override
	public List<SystemUser> getSystemUserByPhoneNumber(String phoneNumber) {
		// TODO Auto-generated method stub
		return systemUserDao.getSystemUserByPhoneNumber(phoneNumber);
	}

	@Override
	public List<SystemUser> getSystemUserByAddress(String address) {
		// TODO Auto-generated method stub
		return systemUserDao.getSystemUserByAddress(address);
	}

	@Override
	public List<SystemUser> getSystemUserByIDCardNumber(String idCardNumber) {
		// TODO Auto-generated method stub
		
		return systemUserDao.getSystemUserByIDCardNumber(idCardNumber);
	}
	@Override
	public List<SystemUser> getSystemUserByEmail(String email) {
		// TODO Auto-generated method stub
		return systemUserDao.getSystemUserByEmail(email);
	}
	@Override
	public List<SystemUser> getSystemUser() {
		// TODO Auto-generated method stub
		return systemUserDao.getSystemUser();
	}

	@Override
	public long createRecordLogin(SystemRecordLogin systemRecordLogin) {
		// TODO Auto-generated method stub
		return systemUserDao.createRecordLogin(systemRecordLogin);
	}

	@Override
	public long getSystemUserIDByUserName(String userName) {
		// TODO Auto-generated method stub
		return systemUserDao.getSystemUserIDByUserName(userName);
	}
	@Override
	public List<Long> getRoleByUserName(String username) {
		// TODO Auto-generated method stub
		return systemUserDao.getRoleByUserName(username);
	}
	@Override
	public SystemUser get1SystemUserByID(long systemUserID) {
		// TODO Auto-generated method stub
		return systemUserDao.get1SystemUserByID(systemUserID);
	}
	
	@Override
	public List<SystemRecordLogin> getRecordLogin() {
		// TODO Auto-generated method stub
		return systemUserDao.getRecordLogin();
	}
	@Override
	public List<SystemRecordLogin> getRecordLoginByID(long systemUserID, Timestamp fromDate, Timestamp toDate) {
		
		// TODO Auto-generated method stub
		return systemUserDao.getRecordLoginByID(systemUserID, fromDate, toDate);
	}
	@Override
	public List<SystemRecordLogin> getRecordLoginByDate(Timestamp from,
			Timestamp to) {
		System.out.println(to);
		// TODO Auto-generated method stub
		return systemUserDao.getRecordLoginByDate(from, to);
	}
	

}
